package myutil.classloader;

/**
 *
 * @author Hlib_Babii
 */
public class DCCLRun {

    static public void main(String args[]) throws Exception {
        String progClass;
        //String progArgs[];
        if (args.length == 0) {
            progClass = "myutil.classloader.TestModule";
            //progClass = "java.util.Collection";
            //progArgs = new String[0];
        } else {
            progClass = args[0];
//            progArgs = new String[args.length - 1];
//            System.arraycopy(args, 1, progArgs, 0, progArgs.length);
        }
        while (true) {
            ClassLoader ccl = new DynamicCompilingClassLoader(
                    "C:\\Users\\Hlib_Babii@epam.com\\Documents\\NetBeansProjects\\myutil\\src\\"
                    , "C:\\Users\\Hlib_Babii@epam.com\\Documents\\NetBeansProjects\\myutil\\build\\classes\\"
                    );
            Class aClass = ccl.loadClass(progClass);
            System.out.println(aClass.newInstance());
            Thread.sleep(2000);
        }
    }
}
